#!/usr/bin/env python
# encoding: utf-8
__author__ = 'Zjay '
"""
@version: 3.6.3
@author: Zjay 
@license: Apache Licence 
@site: 
@software: PyCharm
@file: Grammar_Test_ConfigPaeser.py
@time: 2017/12/11 13:25
"""
# region 读取配置文件（config.ini）

from configparser import ConfigParser
import sys
print (sys.path)
path ='D:\Project\Project_Git\Python_test\python_test\Comm\config.ini'
cfg = ConfigParser()
cfg.read(path)
lists_header = cfg.sections()
print(lists_header)
if cfg.has_section(lists_header[0]):
    lib = cfg.get(lists_header[0], 'library')
    print(lib)
    cfg.set(lists_header[0], 'library',path)
    cfg.write(open(path, 'w'))



# endregion
